/**
 * TODO
 * @Project: topcrazy
 * @Title: SystemMenuController.java
 * @Package net.topcrazy.blog.controller.sys
 * @author notepad
 * @Date Sep 23, 2012 10:37:11 AM
 * @Copyright: 2012 www.topcrazy.net
 * @Version v1.0.0
 */
package net.topcrazy.blog.controller.sys;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import net.topcrazy.base.common.BaseController;
import net.topcrazy.base.common.SessionGlobal;
import net.topcrazy.blog.pojo.dto.TsysMenuDto;
import net.topcrazy.blog.service.TsysMenuService;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.util.WebUtils;

/**
 * TODO
 * 
 * @ClassName: SystemMenuController
 * @author notepad
 */
@Controller
@RequestMapping("/sys/menu")
public class SystemMenuController extends BaseController
{
	private final Logger log = Logger.getLogger(SystemMenuController.class);
	@Autowired
	private TsysMenuService tsysMenuService;

	@RequestMapping(value="/loadMenu")
	@ResponseBody
	public List<TsysMenuDto> loadMenu(HttpServletRequest request)
	{
		try
		{
			
			return tsysMenuService.loadMenu(this.getSessionGlobal(request).getAccountId());
		} catch (Exception e)
		{
			log.error(e);
		}
		return null;
	}

}
